package com.zhongfl.crm.lixiao.mapper;

import com.zhongfl.crm.model.boss.Order;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * tb_order
 * Created by wangkun23 on 2018/1/17.
 */
public interface OrderMapper {
    int deleteByPrimaryKey(Integer id);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer id);

    /**
     * 更新订单  updateByPrimaryKeySelective
     *
     * @param record
     * @return
     */
    int updateOrder(Order record);

    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @return
     */
    Order selectByOrderNo(@Param("orderNo") String orderNo);
    /**
     * 查询取消的所有订单
     *
     */
    List<Order> selectOrderCancel();

    /**
     * 根据客户姓名获取订单
     *
     * @param name
     * @return
     */
    List<Order> selectByUserName(@Param("name") String name);

    /**
     * 根据客户订单号查询交付订单列表
     */
    List<Order> findByCustomerOrderNo(String customerOrderNo);

    /**
     * 根据客户订单号和交付巴ID查询交付订单
     * @param customerOrderNo 客户订单号
     * @param deliverManagerAmibaId 交付巴ID
     * @return 交付订单
     */
    Order selectByCustomerOrderNoAndDeliverManagerAmibaId(@Param("customerOrderNo") String customerOrderNo, @Param("deliverManagerAmibaId") Integer deliverManagerAmibaId);

    /**
     * 更新银行信息
     */
    void updateBank(@Param("orderNo") String orderNo, @Param("receiveAmibaBankId") Integer receiveAmibaBankId);

    void updateLxDeliverOrderId(@Param("orderNo") String orderNo, @Param("lxId") Long lxId);
}